<%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Administration.Modules.ProductVariantAttributeValuesControl"
    CodeBehind="ProductVariantAttributeValues.ascx.cs" %>
<%@ Register TagPrefix="nopCommerce" TagName="ToolTipLabel" Src="ToolTipLabelControl.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="SimpleTextBox" Src="SimpleTextBox.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="NumericTextBox" Src="NumericTextBox.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="DecimalTextBox" Src="DecimalTextBox.ascx" %>
<div class="section-header">
    <div class="title">
        <img src="Common/ico-catalog.png" alt="" />
        <asp:Label ID="lblTitle" runat="server" />
        <asp:Label ID="lblProductName" runat="server" />
    </div>
</div>
<asp:GridView ID="gvProductVariantAttributeValues" runat="server" AutoGenerateColumns="false"
    DataKeyNames="ProductVariantAttributeValueID" OnRowDeleting="gvProductVariantAttributeValues_RowDeleting"
    OnRowDataBound="gvProductVariantAttributeValues_RowDataBound" OnRowCommand="gvProductVariantAttributeValues_RowCommand"
    Width="100%">
    <Columns>
        <asp:TemplateField HeaderText="Name" ItemStyle-Width="20%">
            <ItemTemplate>
                <asp:HiddenField ID="hfProductVariantAttributeValueID" runat="server" Value='<%# Eval("ProductVariantAttributeValueID") %>' />
                <nopCommerce:SimpleTextBox runat="server" CssClass="adminInput" ID="txtName" ValidationGroup="ProductVariantAttributeValue"
                    ErrorMessage="Name is required" Text='<%# Eval("Name") %>'></nopCommerce:SimpleTextBox>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Price Adjustment" HeaderStyle-HorizontalAlign="Center"
            ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <nopCommerce:DecimalTextBox runat="server" CssClass="adminInput" Width="50px" Value='<%# Eval("PriceAdjustment") %>'
                    ID="txtPriceAdjustment" RequiredErrorMessage="Price adjustment is required" MinimumValue="0"
                    MaximumValue="999999" ValidationGroup="ProductVariantAttributeValue" RangeErrorMessage="The value must be from 0 to 999999">
                </nopCommerce:DecimalTextBox>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Weight Adjustment" HeaderStyle-HorizontalAlign="Center"
            ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <nopCommerce:DecimalTextBox runat="server" CssClass="adminInput" Width="50px" Value='<%# Eval("WeightAdjustment") %>'
                    ID="txtWeightAdjustment" RequiredErrorMessage="Weight adjustment is required"
                    MinimumValue="0" MaximumValue="999999" ValidationGroup="ProductVariantAttributeValue"
                    RangeErrorMessage="The value must be from 0 to 999999"></nopCommerce:DecimalTextBox>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Is pre-selected" HeaderStyle-HorizontalAlign="Center"
            ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:CheckBox runat="server" Checked='<%# Eval("IsPreSelected") %>' ID="cbIsPreSelected"
                    ValidationGroup="ProductVariantAttributeValue"></asp:CheckBox>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Display order" HeaderStyle-HorizontalAlign="Center"
            ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <nopCommerce:NumericTextBox runat="server" CssClass="adminInput" Width="50px" ID="txtDisplayOrder"
                    Value='<%# Eval("DisplayOrder") %>' RequiredErrorMessage="Display order is required"
                    RangeErrorMessage="The value must be from -99999 to 99999" ValidationGroup="ProductVariantAttributeValue"
                    MinimumValue="-99999" MaximumValue="99999"></nopCommerce:NumericTextBox>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Update" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Button ID="btnUpdate" runat="server" CssClass="adminButton" Text="Update" ValidationGroup="ProductVariantAttributeValue"
                    CommandName="UpdateProductVariantAttributeValue" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Delete" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Button ID="btnDeleteProductVariantAttribute" runat="server" CssClass="adminButton"
                    Text="Delete" CausesValidation="false" CommandName="Delete" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
<p>
    <strong>Add new values </strong>
</p>
<table class="adminContent">
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblAttributeName" Text="Name:" ToolTip="The attribute value name e.g. 'Blue' for Color attributes"
                ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <nopCommerce:SimpleTextBox runat="server" CssClass="adminInput" ID="txtNewName" ValidationGroup="NewProductVariantAttributeValue"
                ErrorMessage="Name is required"></nopCommerce:SimpleTextBox>
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblPriceAdjustment" Text="Price adjustment:"
                ToolTip="The price adjustment applied when choosing this attribute value e.g. '10' to add 10 euros."
                ToolTipImage="~/Administration/Common/ico-help.gif" />
            [<%=CurrencyManager.PrimaryStoreCurrency.CurrencyCode%>]:
        </td>
        <td class="adminData">
            <nopCommerce:DecimalTextBox runat="server" CssClass="adminInput" ID="txtNewPriceAdjustment"
                Value="0" RequiredErrorMessage="Price adjustment is required" MinimumValue="0"
                MaximumValue="999999" RangeErrorMessage="The value must be from 0 to 999999"
                ValidationGroup="NewProductVariantAttributeValue"></nopCommerce:DecimalTextBox>
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblWeightAdjustment" Text="Weight adjustment:"
                ToolTip="The weight adjustment applied when choosing this attribute value" ToolTipImage="~/Administration/Common/ico-help.gif" />
            [<%=MeasureManager.BaseWeightIn.Name%>]:
        </td>
        <td class="adminData">
            <nopCommerce:DecimalTextBox runat="server" CssClass="adminInput" ID="txtNewWeightAdjustment"
                Value="0" RequiredErrorMessage="Weight adjustment is required" MinimumValue="0"
                MaximumValue="999999" RangeErrorMessage="The value must be from 0 to 999999"
                ValidationGroup="NewProductVariantAttributeValue"></nopCommerce:DecimalTextBox>
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblPreSelected" Text="Pre-selected:"
                ToolTip="Determines whether this attribute value is pre selected for the customer."
                ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <asp:CheckBox runat="server" Checked="false" ID="cbNewIsPreSelected" ValidationGroup="NewProductVariantAttributeValue">
            </asp:CheckBox>
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblDisplayOrder" Text="Display order:"
                ToolTip="The display order of the attribute value. 1 represents the first item in attribute value list."
                ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <nopCommerce:NumericTextBox runat="server" CssClass="adminInput" ID="txtNewDisplayOrder"
                Value="1" RequiredErrorMessage="Display order is required" RangeErrorMessage="The value must be from -99999 to 99999"
                MinimumValue="-99999" MaximumValue="99999" ValidationGroup="NewProductVariantAttributeValue">
            </nopCommerce:NumericTextBox>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <asp:Button runat="server" ID="btnAdd" CssClass="adminButton" Text="Save" ValidationGroup="NewProductVariantAttributeValue"
                OnClick="btnAdd_Click" ToolTip="Save attribute value" />
        </td>
    </tr>
</table>
